﻿<UserControl x:Class="MySQLProviderODBC.UI.EditDatabase"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:sqcon="clr-namespace:MySQLProviderODBC.UI.Converters"
             mc:Ignorable="d" 
             TextOptions.TextFormattingMode="Display"
             d:DesignHeight="300" d:DesignWidth="300">

    <DockPanel>
        <!--Instructions-->
        <TextBlock DockPanel.Dock="Top" TextWrapping="Wrap" Margin="5">
            Enter the new database name and server details below:
        </TextBlock>

        <Grid DockPanel.Dock="Top">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="110"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <!--Server Name-->
            <Label Grid.Row="0" Grid.Column="0" Style="{StaticResource dialogLabel}" KeyboardNavigation.TabIndex="0">Server Name:</Label>
            <TextBox Grid.Row="0" Grid.Column="1" Style="{StaticResource dialogTextbox}" KeyboardNavigation.TabIndex="1"
                     Text="{Binding Path=DatabaseToEdit.DatabaseServer.ServerName, Mode=TwoWay}"/>


            <!--Database Name-->
            <Label Grid.Row="1" Grid.Column="0" Style="{StaticResource dialogLabel}" KeyboardNavigation.TabIndex="2">Database Name:</Label>
            <TextBox Grid.Row="1" Grid.Column="1" Style="{StaticResource dialogTextbox}" KeyboardNavigation.TabIndex="3"
                     Text="{Binding Path=DatabaseToEdit.DatabaseName, Mode=TwoWay}"/>

            <!--Port number-->
            <Label Grid.Row="2" Grid.Column="0" Style="{StaticResource dialogLabel}" KeyboardNavigation.TabIndex="2">Port Number:</Label>
            <TextBox Grid.Row="2" Grid.Column="1" Style="{StaticResource dialogTextbox}" Text="{Binding Path=Port, Mode=TwoWay}"
                     KeyboardNavigation.TabIndex="3"/>

            <!--Driver Version-->
            <Label Grid.Row="3" Grid.Column="0" Style="{StaticResource dialogLabel}" KeyboardNavigation.TabIndex="4">Driver Version:</Label>
            <ComboBox Grid.Row="3" Grid.Column="1" Style="{StaticResource dialogCombo}" Text="{Binding Path=Version, Mode=TwoWay}" KeyboardNavigation.TabIndex="5">
                <ComboBoxItem>MySQL ODBC 3.51 Driver</ComboBoxItem>
                <ComboBoxItem>MySQL ODBC 5.1 Driver</ComboBoxItem>
            </ComboBox>
        </Grid>

        <!--Security Details-->
        <GroupBox DockPanel.Dock="Top" Header="Security Details" Style="{StaticResource serverDetails}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="90"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>

                <!--User name-->
                <Label Grid.Row="0" Grid.Column="0" Style="{StaticResource dialogLabel}" KeyboardNavigation.TabIndex="5">User Name:</Label>
                <TextBox Grid.Row="0" Grid.Column="1" Style="{StaticResource dialogTextbox}" KeyboardNavigation.TabIndex="6"
                         Text="{Binding Path=UserName, Mode=TwoWay}"/>

                <!--Password-->
                <Label Grid.Row="1" Grid.Column="0" Style="{StaticResource dialogLabel}" KeyboardNavigation.TabIndex="7">Password:</Label>
                <TextBox Grid.Row="1" Grid.Column="1" Style="{StaticResource dialogTextbox}" KeyboardNavigation.TabIndex="8"
                         Text="{Binding Path=Password, Mode=TwoWay}"/>
            </Grid>
        </GroupBox>
    </DockPanel>
</UserControl>
